#include "CH58x_common.h"
#include "stdint.h"
#include "DevicesUID.h"


char *pucMcuUIDRead(void)
{
    static char ucUIDBuff[17] = {0};
    uint8_t ucBuff[8], i;

    if(ucUIDBuff[0] == 0)
    {
        GET_UNIQUE_ID(ucBuff);

        for(i = 0; i < 8; ++i)
        {
            ucUIDBuff[i * 2]     = "0123456789ABCDEF"[ucBuff[i] >> 4];
            ucUIDBuff[i * 2 + 1] = "0123456789ABCDEF"[ucBuff[i] & 0xF];
        }
    }

    return ucUIDBuff;
}
